package com.tencent.mm.opensdk.modelmsg;

import android.os.Bundle;
import android.util.Log;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;

public class LaunchFromWX {
    public static class Req extends BaseReq {
        private static final int MESSAGE_ACTION_LENGTH_LIMIT = 2048;
        private static final int MESSAGE_EXT_LENGTH_LIMIT = 2048;
        private static final String TAG = "MicroMsg.SDK.LaunchFromWX.Req";
        public String country;
        public String lang;
        public String messageAction;
        public String messageExt;

        public Req() {

        }

        public Req(Bundle arg1) {

            this.fromBundle(arg1);
        }

        public boolean checkArgs() {
            int v2 = 2048;
            boolean v0 = false;
            if(this.messageAction == null || this.messageAction.length() <= v2) {
                if(this.messageExt != null && this.messageExt.length() > v2) {
                    Log.e("MicroMsg.SDK.LaunchFromWX.Req", "checkArgs fail, messageExt is too long");
                    return v0;
                }

                v0 = true;
            }
            else {
                Log.e("MicroMsg.SDK.LaunchFromWX.Req", "checkArgs fail, messageAction is too long");
            }

            return v0;
        }

        public void fromBundle(Bundle arg2) {
            super.fromBundle(arg2);
            this.messageAction = arg2.getString("_wxobject_message_action");
            this.messageExt = arg2.getString("_wxobject_message_ext");
            this.lang = arg2.getString("_wxapi_launch_req_lang");
            this.country = arg2.getString("_wxapi_launch_req_country");
        }

        public int getType() {
            return 6;
        }

        public void toBundle(Bundle arg3) {
            super.toBundle(arg3);
            arg3.putString("_wxobject_message_action", this.messageAction);
            arg3.putString("_wxobject_message_ext", this.messageExt);
            arg3.putString("_wxapi_launch_req_lang", this.lang);
            arg3.putString("_wxapi_launch_req_country", this.country);
        }
    }

    public class Resp extends BaseResp {
        public Resp() {

        }

        public Resp(Bundle arg1) {

            this.fromBundle(arg1);
        }

        public boolean checkArgs() {
            return true;
        }

        public int getType() {
            return 6;
        }
    }

    private LaunchFromWX() {

    }
}

